package com.meilai.project.service.business.installOrder;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.meilai.project.dto.app.WorkerSubmitDeviceDTO;
import com.meilai.project.dto.app.WorkerSubmitRepairDTO;
import com.meilai.project.dto.business.installOrder.WorkerRepairPointDTO;
import com.meilai.project.dto.business.installOrder.WorkerSubmitChangePhotoDTO;
import com.meilai.project.dto.business.installOrder.WorkerSubmitCheckDTO;
import com.meilai.project.dto.business.installOrder.WorkerSubmitListDTO;
import com.meilai.project.entity.business.installOrder.WorkerSubmit;
import com.meilai.project.vo.business.installOrder.*;

import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 工人提交 服务类
 * </p>
 *
 * @author 张驰
 * @since 2022-03-21
 */
public interface WorkerSubmitService extends IService<WorkerSubmit> {
    boolean changePhotoForApp(WorkerSubmitChangePhotoDTO dto);

    WorkerSubmitForAppVO getAuditForApp(Long id);

    List<WorkerSubmit> listByWorkOrderIds(List<Long> workOrderIds);

    List<WorkerSubmit> listByWorkOrderId(Long workOrderId);

    // 工人提交
    boolean addOneForApp(WorkerSubmitDeviceDTO dto);

    Page<WorkerRepairPointVO> selectListNeedRepairPoint(WorkerRepairPointDTO searchDTO);

    int listTotal();

    // 维修申报
    boolean submitToApplyRepair(WorkerSubmitRepairDTO dto);

    void updateRepairStatus(Long workOrderId, List<Long> ids);

    // 查询审核列表表头显示的数量
    List<WorkerSubmitStatusCountVO> workerSubmitStatusCount(Long workOrderId);

    // 查询审核列表
    Page<WorkerSubmitVO> workerSubmitCheckList(WorkerSubmitListDTO workerSubmitStatus);

    List<WorkerOrderSelectOptionsVO> workerOrderSelectOptions(Long workerSubmitId);

    List<NewInstallBuildingAndMediaTypeVO> newInstallBuildingAndMediaTypeVO(Long workOrderId);

    //通过
    void pass(WorkerSubmitCheckDTO workerSubmitCheckDTO);

    //改变审核状态
    void changeCheckStatus(Integer status, List<Long> ids);

    void delete(List<Long> ids);


    Page<WorkerSubmitVO> page(Integer current_page, Integer page_size, LocalDate begin_time, LocalDate end_time, Long work_order_id, Long worker_id, List<Integer> work_order_type_ids, Integer status, String code, Long building_area_id, Long media_type_id, Boolean statistics, LocalDate begin_time_save, LocalDate end_time_save);

    void exportExcel(Integer current_page, Integer page_size, LocalDate begin_time, LocalDate end_time, Long work_order_id, Long worker_id, List<Integer> work_order_type_ids, Integer status, String code, Long building_area_id, Long media_type_id, HttpServletResponse response, Boolean statistics, LocalDate begin_time_save, LocalDate end_time_save);

    /**
     * 安装数量统计分页
     *
     * @param current_page
     * @param page_size
     * @param startDate
     * @param endDate
     * @param worker_id
     * @param media_type_id
     * @param work_order_type_id
     * @return
     */
    Page<WorkerSubmitCountVO> installCountPage(Integer current_page, Integer page_size, LocalDate startDate, LocalDate endDate, Long worker_id, Long media_type_id, Long work_order_type_id);

    /**
     * 上画明细统计分页
     *
     * @param current_page
     * @param page_size
     * @param startDate
     * @param endDate
     * @param worker_id
     * @param building_area_id
     * @param work_order_type_id
     * @param customer_id
     * @return
     */
    Page<WorkerSubmitVO3> installCountRecord(Integer current_page, Integer page_size, LocalDate startDate, LocalDate endDate, Long worker_id, Long building_area_id, Long work_order_type_id, Long customer_id);

    /**
     * 替换图片
     *
     * @param id
     * @param oldUrl
     * @param newUrl
     * @return
     */
    Boolean replacePhoto(Long id, String oldUrl, String newUrl);
}
